﻿Public Class personalize

    Private Sub personalize_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        lbl_hour.ForeColor = Color.White
        lbl_date.ForeColor = Color.White
        preview.Height = 337
        If My.Settings.Back = "" Then
            preview.BackgroundImage = My.Resources.LOCK
        Else
            preview.BackgroundImage = Image.FromFile(My.Settings.Back)
        End If


        lbl_hour.Text = TimeOfDay.Hour & ":" & TimeOfDay.Minute
        lbl_date.Text = Date.Today.ToLongDateString
    End Sub

    Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
        My.Settings.Back = OpenFileDialog1.FileName
        preview.BackgroundImage = Image.FromFile(My.Settings.Back)
        Form1.BackgroundImage = Image.FromFile(My.Settings.Back)
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        preview.BackgroundImage = My.Resources.LOCK
        My.Settings.Back = ""
        Form1.BackgroundImage = My.Resources.LOCK
    End Sub
End Class
